<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="jquery-3.2.1.min.js"></script>
    <script>
        function upload() {
            var formData = new FormData($("#f1")[0]);
            $.ajax({
                url: '/upload/add',
                type: 'POST',
                data: formData,
                dataType:"json",
                contentType: false,
                processData: false,
                success: function (returnData) {
                    alert(JSON.stringify(returnData));
                }
            });
        }
    </script>
</head>
<body>
    <form action="/upload/add" method="post" enctype="multipart/form-data">
        姓名：<input type="text" name="name"><br>
        头像：<input type="file" name="face"><br>
        <input type="submit" value="提交">
    </form>

<hr>
    <form id="f1">
        姓名：<input type="text" name="name"><br>
        头像：<input type="file" name="face"><br>
        <input type="button" value="提交" onclick="upload()">
    </form>
</body>
</html>